Problem: Let $G$ be the centroid of triangle $ABC.$  If $GA^2 + GB^2 + GC^2 = 58,$ then find $AB^2 + AC^2 + BC^2.$
Answer: Let $\mathbf{a}$ denote $\overrightarrow{A},$ etc.  Then
\[\mathbf{g} = \frac{\mathbf{a} + \mathbf{b} + \mathbf{c}}{3},\]so
\begin{align*}
GA^2 &= \|\mathbf{g} - \mathbf{a}\|^2 \\
&= \left\| \frac{\mathbf{a} + \mathbf{b} + \mathbf{c}}{3} - \mathbf{a} \right\|^2 \\
&= \frac{1}{9} \|\mathbf{b} + \mathbf{c} - 2 \mathbf{a}\|^2 \\
&= \frac{1}{9} (\mathbf{b} + \mathbf{c} - 2 \mathbf{a}) \cdot (\mathbf{b} + \mathbf{c} - 2 \mathbf{a}) \\
&= \frac{1}{9} (4 \mathbf{a} \cdot \mathbf{a} + \mathbf{b} \cdot \mathbf{b} + \mathbf{c} \cdot \mathbf{c} - 4 \mathbf{a} \cdot \mathbf{b} - 4 \mathbf{a} \cdot \mathbf{c} + 2 \mathbf{b} \cdot \mathbf{c}).
\end{align*}Hence,
\[GA^2 + GB^2 + GC^2 = \frac{1}{9} (6 \mathbf{a} \cdot \mathbf{a} + 6 \mathbf{b} \cdot \mathbf{b} + 6 \mathbf{c} \cdot \mathbf{c} - 6 \mathbf{a} \cdot \mathbf{b} - 6 \mathbf{a} \cdot \mathbf{c} - 6 \mathbf{b} \cdot \mathbf{c}) = 58,\]so
\[\mathbf{a} \cdot \mathbf{a} + \mathbf{b} \cdot \mathbf{b} + \mathbf{c} \cdot \mathbf{c} - \mathbf{a} \cdot \mathbf{b} - \mathbf{a} \cdot \mathbf{c} - \mathbf{b} \cdot \mathbf{c} = 87.\]Then
\begin{align*}
AB^2 + AC^2 + BC^2 &= \|\mathbf{a} - \mathbf{b}\|^2 + \|\mathbf{a} - \mathbf{c}\|^2 + \|\mathbf{b} - \mathbf{c}\|^2 \\
&= (\mathbf{a} \cdot \mathbf{a} - 2 \mathbf{a} \cdot \mathbf{b} + \mathbf{b} + \mathbf{b}) \\
&\quad + (\mathbf{a} \cdot \mathbf{a} - 2 \mathbf{a} \cdot \mathbf{c} + \mathbf{c} + \mathbf{c}) \\
&\quad + (\mathbf{b} \cdot \mathbf{b} - 2 \mathbf{b} \cdot \mathbf{c} + \mathbf{c} + \mathbf{c}) \\
&= 2 (\mathbf{a} \cdot \mathbf{a} + \mathbf{b} \cdot \mathbf{b} + \mathbf{c} \cdot \mathbf{c} - \mathbf{a} \cdot \mathbf{b} - \mathbf{a} \cdot \mathbf{c} - \mathbf{b} \cdot \mathbf{c}) \\
&= \boxed{174}.
\end{align*}